{template header}
<style type="text/css">
.in_text_cla1{ padding:2px; background:#FFF; border:#CCC 1px solid; vertical-align:middle; margin:0 2px;}
/**/
.button_1_cla1 ,.button_1_cla2{ float:left; margin-right:10px; }
.button_1_cla1 a ,.button_1_cla2 a{ color:#FFF; font-weight:bold;}
.button_1_cla1{ padding-left:4px; background:url(/images/default/button_left_cla1.gif) 0 0 no-repeat;}
.button_r_cla1{ padding-right:4px; background:url(/images/default/button_right_cla1.gif) right top no-repeat;}
.button_m_cla1{ padding:0 2px; background:#093; line-height:28px;}
.button_1_cla2{ padding-left:4px; background:url(/images/default/button_left_cla2.gif) 0 0 no-repeat;}
.button_r_cla2{ padding-right:4px; background:url(/images/default/button_right_cla2.gif) right top no-repeat; }
.button_m_cla2{ padding:0 2px; background:#9C0; line-height:28px;}
.submit{background: none; border: 0px; color: #fff; font-weight: bold; height: 28px;}
</style>
<script language="javascript" type="text/javascript">	

J(function(){
	bopuruiObj.category = {
		Symbol: '',
		init: function(){
		
			bopuruiObj.command.webTitle('我的购物车');
			
			_this = this;
			
			J('input[name=pCount]').bind('keypress', function(){_this.strMacth(J(this));}).bind('blur', function(){_this.strMacth(J(this));}).bind('keyup', function(){_this.strMacth(J(this));});

			J('#clearShopping').bind('click', function(){
				if(confirm('您确定要清空购物车吗?')){
					var cartId = '';
					J('input[name=cartId]').each(function(){cartId = cartId + J(this).val() + '-';});
					J.ajax({
						url: 'cart.htm?action=clear&cartId='+cartId,
						cache: false,
						dataType: 'json',
						success: function(data){
							if(data['state']==1) {
								J('.t_nav').remove();
								J('.td_b_on').remove();
								J('.t_maincla1').html('<table width="100%" border="0" cellpadding="0" cellspacing="0" id="shoppingItem"><tr class="td_b_on"><td colspan="8" style="width: 13%; line-height: 15px; color: #ff0000; padding-left: 8px;">你的购物车中还没有信息!</td></tr></table>');
							}
						}
					});
				}
			});
			
			J('a[id=del]').bind('click', function(){
				if(confirm('您确定要删除吗?')){
					var productId = J(this).attr('productId');
					J.ajax({
						url: 'cart.htm?action=del&productId='+productId,
						cache: false,
						dataType: 'json',
						success: function(data){
							if(data['state']==1) {
								J('#J_Total').html('￥'+data['pr']['totalPrice']);
								J('#cartCount').html(data['pr']['cartCount']);
								J('#tr_'+productId).remove();
							}
						}
					});
				}
			});
			
			J('a[id=add]').bind('click', function(){
				var productId = J(this).attr('productId');	
				var price = J('#pCount_'+productId).val();
				var key = J(this).attr('key');
				if((parseInt(price)+1)>99999){
					alert('购买数量超限！');
					return false;
				}				
				J('#pCount_'+productId).val(parseInt(price)+1);					
				_this.getAjax('add', productId, key);
			});
			
			J('a[id=less]').bind('click', function(){
				var productId = J(this).attr('productId');	
				var price = J('#pCount_'+productId).val();
				var key = J(this).attr('key');
		
				if(parseInt(price)>1) {
					J('#pCount_'+J(this).attr('productId')).val(parseInt(price)-1);
					_this.getAjax('less', productId, key);
				}
			});
			
			bopuruiObj.command.mtabletr();
		},
		getAjax: function(type, productId, key, value){
			_this = this;
			J.ajax({
				url: 'cart.htm?action='+type+'&productId='+productId+'&value='+value,
				cache: false,
				dataType:'json',
				success: function(data){
					if(data['state']==1) {
						J('#J_Total').html('￥'+data['pr']['totalPrice']);
						J('#total_'+productId).html(_this.Symbol+data['pr']['shopCartArr'][key]['totalPrice']);
						J('#offer_'+productId).html(_this.Symbol+data['pr']['shopCartArr'][key]['offerPrice']);
						J('#cartCount').html(data['pr']['cartCount']);
					}
				}
			});
		},
		strMacth: function(__this){			
			if(/[^\d]/g.test(__this.val())){
				__this.val(__this.val().replace(/[^\d]/g,''));
			}
			if(__this.val().substr(0,1)==0){
				__this.val(__this.val().replace(/^0*/g,''));
			}
			if(__this.val().length>5){
				__this.val(__this.val().substr(0,5));
				alert('购买数量超限！');
				return false;
			}
			var productSum = __this.val();
			
				var productId = __this.attr('productId');	
				var key = __this.attr('key');
				this.getAjax('update', productId, key, productSum);
			
		}
	}

	bopuruiObj.category.init();
});

</script>

<div class="top_1"></div>
<div class="top_2">
	<div class="con_left">
		{template userlogin}
	</div>
	<div class="con_box_left">
		<form id="Form1" method="post" action="cart-consignee.htm">
		<div class="t_maincla1">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top:0px; font-size:14px" class="table1">
			<tr>
				<td width="11%" height="35" align="center" bgcolor="#EAEAEA" style="background:#EAEAEA; background-position:0 5px"><strong>订货号</strong></td>
				<td width="18%" align="center" bgcolor="#EAEAEA" style="background:#EAEAEA url(images/darkgreen/l_013.gif) no-repeat; background-position:0 5px"><strong>产品说明</strong></td>
				<td width="13%" align="center" bgcolor="#EAEAEA" style="background:#EAEAEA url(images/darkgreen/l_013.gif) no-repeat; background-position:0 5px"><strong>市场价格</strong></td>
				<td width="15%" align="center" bgcolor="#EAEAEA" style="background:#EAEAEA url(images/darkgreen/l_013.gif) no-repeat; background-position:0 5px"><strong>会员价格</strong></td>
				<td width="14%" align="center" bgcolor="#EAEAEA" style="background:#EAEAEA url(images/darkgreen/l_013.gif) no-repeat; background-position:0 5px"><strong>小计</strong></td>
				<td width="12%" align="center" bgcolor="#EAEAEA" style="background:#EAEAEA url(images/darkgreen/l_013.gif) no-repeat; background-position:0 5px"><strong>优惠</strong></td>
				<td width="11%" align="center" bgcolor="#EAEAEA" style="background:#EAEAEA url(images/darkgreen/l_013.gif) no-repeat; background-position:0 5px"><strong>数量</strong></td>
				<td width="6%" align="center" bgcolor="#EAEAEA" style="background:#EAEAEA url(images/darkgreen/l_013.gif) no-repeat; background-position:0 5px"><strong>删除</strong></td>
			</tr>
		   <!--{loop $pArr[shopCartArr] $key $list}-->
			<tr id="tr_$list[productId]" >
			  <td style="border-bottom:1px dashed #999999; padding-left:5px;" height="30"><input type="hidden" name="cartId" value="{$list[cartId]}" />{$list[promotions]}<font class="ari"><!--{$list[productNo]}--></font></td>
				<td style="border-bottom:1px dashed #999999; padding-left:15px;"><a class='alt' href="#" _fcksavedurl="#"><span>{$list[content]}</span><font class="ari" >{$list[contents]}</font></a></td>
				<td align="right" style="border-bottom:1px dashed #999999; padding-right:10px;"><font class="scj"><!--{$list[ourPrice]}--></font></td>
				<td align="right" style="border-bottom:1px dashed #999999; padding-right:10px;"><font class="hyj"><!--{$list[userPrice]}--></font></td>
				<td align="right" style="border-bottom:1px dashed #999999; font-size:12pt; font-weight:bold;padding-right:10px;font-weight:bold;font-family:Arial, Helvetica, sans-serif" id="total_$list[productId]"><!--{$list[totalPrice]}--></td>
				<td align="right" style="border-bottom:1px dashed #999999; font-size:12pt; font-weight:bold; padding-right:10px;font-family:Arial, Helvetica, sans-serif" id="offer_$list[productId]"><!--{$list[offerPrice]}--></td>
				<td align="center" style="border-bottom:1px dashed #999999; padding-left:5px;">
				<a id="less" key=$key productId="$list[productId]" href="#1" style="display:block; margin-top:5px; float:left;width:10px; height:10px; line-height:10px; border:1px solid #DBDBDB">-</a>
				<input key=$key productId="$list[productId]" type="text" value="$list[cartCount]" name="pCount" id='pCount_$list[productId]' class="in_text_cla1" style="width: 40px; height:16px; line-height:16px; text-align: center; float:left" maxlength="6" />
				<a id="add" key=$key productId="$list[productId]" href="#1" style="display:block; margin-top:5px; float:left;width:10px; height:10px; line-height:10px; border:1px solid #DBDBDB">+</a>
				</td>
				<td align="center" style="border-bottom:1px dashed #999999;"><a id="del" productId="$list[productId]" href="#1">删除</a></td>
			</tr>
			<!--{/loop}-->
			<!--{if $pArr[cartCount]==0}-->
			<tr>
				<td colspan="8" style="width: 13%; line-height: 15px; padding: 5px;">你的购物车中还没有信息!</td>
			</tr>
			<!--{/if}-->
        </table>
		</div>
	  <!--{if $pArr[cartCount]>0}-->
	  <div class="t_nav" style="margin:0px;">
				
				  <div  style="font-size:12px;float:right; height:40px; line-height:40px;">
					
					 商品总价(不含运费)：<em id="J_Total" style=" font-family:Verdana, Arial, Helvetica, sans-serif;font-size:18px; color:#FE6500">￥{$pArr[totalPrice]}</em>元						
		 		 </div>
	  </div>
	  <div class="t_nav" style="clear:both; margin:0px;">
		  <table width="100%" border="0" cellpadding="0" cellspacing="0">
			  <tr>
				  <td width="20%" align="right" valign="bottom" style="padding-right:20px;"><img src="/images/default/qingkong.gif" />
			    <input name="按钮" type="button" id="clearShopping"  value="清空购物车" style="height:18px;background-color:#FFFFFF" /></td>
				  <td width="80%" align="right" valign="middle" style="text-align:right">
								 <a href="product-list.htm"><img src="/images/default/jixu.gif" /></a>
                              	<input   type=image   name= "Submit " border= "0 "   src= "/images/default/jiesuan.gif"   > </td>
			  </tr>
	    </table>
	  </div>
	  <!--{/if}-->
		</form>
		<p style="text-align:center; font-weight:bold; font-size:14px; color:#2BA326 "><!-- 会员采购本商城产品累计折后价格达到相应等级后,请直接联系我们的客服,修改相应采购折扣后,再进行付款,谢谢！ --></p>


			
  </div>
</div>
<div class="top_3"></div>
{template footer}